﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AgentSite.Master" AutoEventWireup="true" CodeBehind="CustomersList.aspx.cs" Inherits="Agents.Agent.CustomersList" %>
<%@ Import Namespace="Agents.Data" %>

<asp:Content ID="Header" ContentPlaceHolderID="Header" runat="server">
</asp:Content>
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">
    <h1>
        לקוחות קיימים
    </h1>            
    <hr />       
     סינון לפי שם: <asp:TextBox ID="txtCustomerName" runat="server" />
    <asp:Button ID="btnFilter" runat="server" UseSubmitBehavior="true" Text="סנן"
        OnClick="btnFilter_Click" CssClass="button"/>
    <asp:DataGrid runat="server" ID="DataGridProjects" AutoGenerateColumns="False"
            AllowPaging="True" PageSize="12" PagerStyle-Mode="NumericPages" 
            DataSourceID="SqlDataSource1" BackColor="White" BorderStyle="None" 
            CellPadding="3" GridLines="Both" 
            onpageindexchanged="DataGridProjects_PageIndexChanged" 
            OnItemCommand="DataGridProjects_ItemCommand"
            CssClass="dataGrid" Font-Names="Verdana" BorderColor="#999999" BorderWidth="1px">
            <AlternatingItemStyle BackColor="#DCDCDC" />
            <Columns>
                <asp:BoundColumn DataField="Id" Visible="false" />
                <asp:BoundColumn DataField="Name" HeaderText="שם לקוח" HeaderStyle-Width="70%" ItemStyle-Width="70%" FooterStyle-Width="70%" />
                <asp:ButtonColumn CommandName="Watch" HeaderText="צפיה" Text="צפה" HeaderStyle-Width="10%" ItemStyle-Width="10%" FooterStyle-Width="10%" />
                <asp:ButtonColumn CommandName="Edit" HeaderText="עריכה" Text="ערוך" HeaderStyle-Width="10%" ItemStyle-Width="10%" FooterStyle-Width="10%" />
            </Columns>
         
            <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
            <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
            <ItemStyle BackColor="White" ForeColor="Black" />
            <PagerStyle Mode="NumericPages" BackColor="#999999" ForeColor="Black" HorizontalAlign="Center"></PagerStyle>
            <SelectedItemStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
    </asp:DataGrid>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:AgentConnectionString %>" 
        SelectCommand="SELECT [Id], [Name] 
                        FROM [Clients] 
                        WHERE ([Status] = @Status)
                        ORDER BY [Name]">
        <SelectParameters>
            <asp:Parameter DefaultValue="פעיל" Name="Status" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />           
    <hr />
    <div class="alignCenter">               
        <asp:Button ID="backBtn" Text="חזור" runat="server" onclick="backBtn_Click" CssClass="button"/>
    </div>
</asp:Content>
